package com.cloudcc.mobile.weight;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.cloudcc.mobile.R;

public class LoadingView extends RelativeLayout {
	private Context mContext;
	private ProgressBar progress;
	private TextView mTextView;

	public LoadingView(Context context) {
		super(context);
		mContext = context;
		initView();
	}

	public LoadingView(Context context, AttributeSet attrs) {
		super(context, attrs);
		mContext = context;
		initView();
	}

	private void initView() {
		LayoutInflater.from(mContext).inflate(R.layout.common_loading_view,
				this);
		progress = (ProgressBar) findViewById(R.id.progressBar1);
		mTextView = (TextView) findViewById(R.id.tv_loading);
	}

	public void setImgOnClickListener(OnClickListener listener) {
		progress.setOnClickListener(listener);
	}

	public void setText(int txtRes) {
		mTextView.setText(txtRes);
	}

}
